using System;

namespace GraphEditor.Editor
{
    /// <summary>
    /// Editor关联特性。
    /// 将一个GraphCanvasEditor子类与一个运行时逻辑根类型关联起来。
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class CustomGraphEditorAttribute : Attribute
    {
        /// <summary>
        /// 运行时逻辑根类型
        /// </summary>
        public Type GraphType { get; }
        /// <summary>
        /// 逻辑节点基类型
        /// </summary>
        public Type NodeType { get; }
        /// <summary>
        /// 逻辑边基类型
        /// </summary>
        public Type EdgeType { get; }
        public CustomGraphEditorAttribute(Type graphType, Type nodeType)
        {
            GraphType = graphType;
            NodeType = nodeType;
            EdgeType = null;
        }
        public CustomGraphEditorAttribute(Type graphType, Type nodeType, Type edgeType)
        {
            GraphType = graphType;
            NodeType = nodeType;
            EdgeType = edgeType;
        }
    }

    /// <summary>
    /// 自定义节点绘制特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class CustomNodeViewAttribute : Attribute
    {
        /// <summary>
        /// 逻辑节点类型，指定需要重绘的逻辑节点类型
        /// </summary>
        public Type LogicNodeType { get; }

        public CustomNodeViewAttribute(Type logicNodeType)
        {
            LogicNodeType = logicNodeType;
        }
    }
    /// <summary>
    /// 自定义连线绘制特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public class CustomEdgeViewAttribute : Attribute
    {

    }
}